<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>监理服务系统</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--JQ-->
    <script type="text/javascript" charset="utf-8"
            src="${re.contextPath}/plugin/common/js/jquery-1.8.3.min.js"></script>
    <!--Layui-->
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <!--公用样式JS-->
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <!--进度条-->
</head>


<body>
<!--容器-->

<div class="container clearfix">
    <div class="downModule whitebg" style="height: 100%;">
        <div id="jfsqts">
            <input type="hidden" name="type" id="type" value="${type}">
            <input type="hidden" name="projectId" id="projectId" value="${projectId}">
            <input type="hidden" name="fileName" id="fileName" value="${fileName}">
            <input type="hidden" name="fileId" id="fileId" value="${fileId}">
            <div style="align-content: center;padding: 20px;">
                <h3 align="center">选择接收人</h3>
                <h4 align="left">业主单位：${pdto.owerCompany}</h4>
                <h4 align="left">业主负责人：</h4>
                <div id="jfsqyz_lxbox">
                    <select class="fl" id="yz" name="yz"  style="width: 48%;" lay-verify="required" lay-ignore>
                        <option value="">请选择</option>
                        <#list listleader as vo>
                            <option value="${vo.projectLeader}">${vo.realName}</option>
                        </#list>
                    </select>
<#--                    <#list listleader as vo>-->
<#--                        <div  style="width: 100%">-->
<#--                            <div class="fl" style="border: 1px  solid red;width: 20px;"><input type="radio"-->
<#--                                                                                               style="margin-right: 20px;margin-top: 2px;"-->
<#--                                                                                               name="name"-->
<#--                                                                                               id="${vo.projectLeader}"-->
<#--                                                                                               title="${vo.realName}">-->
<#--                            </div>-->
<#--                            <div class="fl"-->
<#--                                 style="border: 1px  solid red;width: 30px;height: 42.4px;">${vo.realName}</div>-->
<#--                        </div>-->

<#--                    </#list>-->
                </div>
            </div>
        </div>
        <div class="popUpBtn center">
            <button type="button" class="blue bgnone close">关闭</button>
            <button type="button" class="bluebg white" id="commit" onclick="commitClick()">提交</button>
        </div>
    </div>
</div>
<!--公用样式JS-->
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/cardUtils.js"></script>

<script type="text/html" id="toolBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a>
</script>

<script>
    var layer, form, laydate, upload, uploadListIns, element, tableIns, table;
    $(function () {
        layui.use(['form', 'layer', 'element'], function () {
            laydate = layui.laydate;
            form = layui.form;
            element = layui.element;
        });

    });

    function commitClick() {

        var type = '${type}';
        var projectId = '${projectId}';
        var fileName = '${fileName}';
        var fileId = '${fileId}';
        var selectCount = 0;
       var yzUserId= $("select[name='yz']").val();
        if (!yzUserId) {
            layer.msg("请选择业主单位", {icon: 2});
            return;
        }

        var jsonsp = {
            type: type,//监发三签
            projectId: projectId,
            fileId: fileId,
            fileName: fileName,
            yzUserId: yzUserId
        }
        $('#commit').addClass("layui-btn-disabled").attr("disabled", true);
        layerAjax('/supervisor/lcManager/updateStartLcZx', jsonsp, '', function (d) {
            if (d.flag == true) {
                layer.msg(d.msg);
                setTimeout(function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }, 2000)
            } else {
                $('#commit').removeClass("layui-btn-disabled").attr("disabled", false);
                layer.msg(d.msg, {icon: 2});
            }
            console.log(d);
        });

    }

    $('.close').click(function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    });

    function checkClick(checkStatus) {
        //按钮不可用
        $('[type=button]').addClass("layui-btn-disabled").attr("disabled", true);
        var checkStatus = checkStatus;
        var type = "auto";
        if (checkStatus == "3") {
            //填写驳回原因
            layer.open({
                type: 1
                ,
                offset: type, //
                area: ['600px', '300px'],
                id: 'layerDemo' + type //防止重复弹出
                ,
                content: '<div style="align-content: center;"><div style="margin-top: 10px;margin-left: 60px;font-weight:bold;" class="b">驳回原因</div><textarea id="remark"  name="remark" style="width: 450px;height: 100px;margin-left: 60px;margin-bottom: 10px;" placeholder="请填写驳回原因"></textarea></div>'
                ,
                btn: '关闭全部'
                ,
                btnAlign: 'c' //按钮居中
                ,
                shade: 0 //不显示遮罩
                ,
                btn: ['确定', '关闭'] //只是为了演示
                ,
                yes: function () {
                    var remark = $("#remark").val();
                    if (!remark) {
                        layer.msg("请输入驳回原因", {icon: 2});
                        return
                    } else {
                        doCheck(checkStatus);
                    }

                }
                ,
                btn2: function () {
                    layer.closeAll();
                }
            });

        } else {
            doCheck(checkStatus);
        }
    }


</script>
</body>

</html>